/**
 * Created by 熊超超 on 2017/8/5.
 */
import conn from './conn'

const request = (method, url, data = {}) => {
  return conn.request({method, url, data}).then(data => ({data})).catch(err => ({err}))
}

export default {
  login: params => request('post', '/MDMServer/user/login', params),
  logout: params => request('post', '/MDMServer/user/logout', params),
  preDownload: params => request('post', '/MDMServer/user/download', params),
  register: params => request('post', '/MDMServer/user/SC/register', params),
  queryAllDevice: params => request('post', '/MDMServer/mdm/queryAllDevice', params),
  queryOneDevice: params => request('post', '/MDMServer/mdm/queryOneDevice', params),
  sendOrder: params => request('post', '/MDMServer/mdm/push', params)
}
